#ifndef SERIALCOMMUNICATION_H
#define SERIALCOMMUNICATION_H

#include <QObject>
#include <QtSerialPort/QSerialPort>

class SerialCommunication : public QObject
{
Q_OBJECT
public:
    explicit SerialCommunication(QObject *parent = nullptr);
    ~SerialCommunication();

    bool openSerialPort();
    void closeSerialPort();
    bool writeData(const QByteArray &data);
    QByteArray readAllData();

private:
    QSerialPort *serialPort;
    bool isSerialPortOpen;
};

#endif // SERIALCOMMUNICATION_H